-- chess_summon
-- create by xinj
-- 道具：召唤主教雕像

return {
    apply = function(source, target, classId, value)
        -- 召唤5级主教雕像需要清状态
        local prop = PropM.combine(source, "chess", 1);
        local level = PropM.apply(prop, 1);
        if level >= 5 then
            -- 清空负面状态
            CombatStatusM.clearStatusByType(source, COM_STATUS_DEBUFF);
            CombatStatusM.clearStatusByType(source, COM_STATUS_DAMAGE);
            -- 清空debuff
            PropM.deleteProp(source, "debuff");
        end

        local ret = PropertyM.canGainEggs(classId);
        if ret then
            value = ret["summon"];
        end

        return SummonM.doSummon(value);
    end,
};
